<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:p="http://primefaces.prime.com.tr/ui">

    <ui:composition template="/template/DefaultTemplate.xhtml">
        <ui:define name="content">
            <h:form rendered="#{loginBacking.editAccount}">
                <p:panel header="Change Password">
                    <h:panelGrid columns="3">
                        <h:outputText value="User Account ID:"/>
                        <h:outputText value="#{contactEntityController.selected.person}" />
                        <h:outputText value=" "/>

                        <h:outputLabel value="Old Password" />
                        <p:password id="oldpassworld" value="#{contactEntityController.oldPassword}" feedback="false" minLength="0" required="true" requiredMessage="Old PassWord is missing">
                        </p:password>
                        <h:message styleClass="errorMsg" for="oldpassword" />
                        
                        <h:outputLabel value="New Password" for="password" />
                        <p:password id="password" binding="#{password}" value="#{contactEntityController.newPassword}" minLength="6" feedback="true" required="true" requiredMessage="New PassWord is missing">
                        </p:password>
                        <h:message styleClass="errorMsg" for="password" />

                        <h:outputLabel for="confirm" value="Confirm password:" />
                        <p:password id="confirm" required="true" minLength="6" feedback="true" requiredMessage="PassWord is missing">
                            <f:validator validatorId="macTeam.PasswordValidator" />
                            <f:attribute name="password" value="#{password.value}" />
                        </p:password>
                        <h:message styleClass="errorMsg" for="confirm" />                                                       

                    </h:panelGrid>
                    
                    <br />
                    <h:commandButton action="#{contactEntityController.changePassword}" value="Submit"/>
                    <br />
                </p:panel>
            </h:form>
        </ui:define>
    </ui:composition>

</html>
